home *** CD-ROM | disk | FTP | other *** search
- #!---------------------------------------------------------!
- #! !
- #! Copyright 1994, 1995 ToolCraft Development Corporation !
- #! !
- #! ALL RIGHTS RESERVED !
- #! !
- #!---------------------------------------------------------!
- #!
- #!
- #!-------------------------------------------------------------------------
- #PROCEDURE(PowerBrowse,'Power Browse a Page-Loaded List Box'),HLP('~PBProcedureProperties'),WINDOW,QUICK(PowerBrowseWizard(Wizards))
- #LOCALDATA
- OriginalRequest LONG,AUTO
- LocalRequest LONG,AUTO
- LocalResponse LONG,AUTO
- WindowOpened LONG
- WindowInitialized LONG
- ForceRefresh LONG,AUTO
- #ENDLOCALDATA
- #CLASS('Procedure Setup','Upon Entry into the Procedure')
- #CLASS('Before Lookups','Refresh Window ROUTINE, before lookups')
- #CLASS('After Lookups','Refresh Window ROUTINE, after lookups')
- #CLASS('Procedure Exit','Before Leaving the Procedure')
- #PROMPT('&Parameters:',@s80),%Parameters
- #BOXED('Window Settings')
- #PROMPT('Window Operation Mode:',DROP('Use WINDOW setting|Normal|MDI|Modal')),%WindowOperationMode
- #PROMPT('Maximize the Window on Open',CHECK),%AlwaysMaximizeOnOpen,AT(10,,115)
- #PROMPT('Specify the Field to Select on Open',CHECK),%SpecifyFirstField,AT(10,,130)
- #ENABLE(%SpecifyFirstField)
- #PROMPT('Field to Select:',CONTROL),%FirstFieldToSelect
- #VALIDATE(%FirstFieldToSelect,'You Must Specify the Field to Select')
- #ENDENABLE
- #ENDBOXED
- #ENABLE(%INIActive)
- #BOXED('INI File Settings')
- #PROMPT('Save and Restore Window Location',CHECK),%INISaveWindow,DEFAULT(1),AT(10,,130)
- #ENDBOXED
- #ENDENABLE
- #BOXED('Resize Options')
- #PROMPT('Enable Window Resizing',CHECK),%EnableWindowResize,AT(10,,95)
- #ENABLE(%EnableWindowResize)
- #PROMPT('Parent List Box:',FROM(%Control,%ControlTemplate = 'BrowseBox(ToolCraft)')),%ResizeListBox
- #VALIDATE(%ResizeListBox,'You must pick a parent list box for resizing.')
- #ENABLE(%ResizeListBox)
- #PREPARE
- #IF(%SecondaryResizeListBox = %ResizeListBox)
- #CLEAR(%SecondaryResizeListBox)
- #ENDIF
- #ENDPREPARE
- #PROMPT('Enable Secondary Window Resizing',CHECK),%EnableSecondaryResize,AT(10,,130)
- #ENABLE(%EnableSecondaryResize)
- #PROMPT('Child List Box:',FROM(%Control,%ControlTemplate = 'BrowseBox(ToolCraft)' AND %Control <> %ResizeListBox)),%SecondaryResizeListBox
- #VALIDATE(%SecondaryResizeListBox,'You must pick a child list box for resizing.')
- #ENDENABLE
- #ENDENABLE
- #ENDENABLE
- #ENDBOXED
- #EMBED(%GatherSymbols,'Gather Template Symbols'),HIDE
- #DECLARE(%FirstField)
- #DECLARE(%LastField)
- #INSERT(%FieldTemplateStandardButtonMenuPrompt)
- #INSERT(%FieldTemplateStandardEntryPrompt)
- #INSERT(%FieldTemplateStandardCheckBoxPrompt)
- #INSERT(%WindowResizeSetup)
- #MESSAGE('',3)
- #DECLARE(%CmtPos)
- #SET(%CmtPos,65)
- #COMMENT(%CmtPos)
- #ATSTART
- #! #FREE(%ToolCraftIconList)
- #ENDAT
- #AT(%CustomGlobalDeclarations)
- #INSERT(%StandardGlobalSetup(Clarion))
- #ENDAT
-
-
-
-
- #IF(%Parameters)
- %[20]Procedure PROCEDURE%Parameters
- #ELSE
- %[20]Procedure PROCEDURE
- #ENDIF
-
- !--------------------------------------------------------------------------------------------------!
- ! Declarations !
- !--------------------------------------------------------------------------------------------------!
- #FOR(%LocalData)
- %[20]LocalData %LocalDataStatement
- #ENDFOR
- #INSERT(%StandardWindowGeneration)
-
- !--------------------------------------------------------------------------------------------------!
- ! Code Section !
- !--------------------------------------------------------------------------------------------------!
- CODE
-
- #EMBED(%ProcedureSetup,'Procedure Setup')
- #INSERT(%StandardFormula,'Procedure Setup')
- LocalRequest = GlobalRequest
- OriginalRequest = LocalRequest
- LocalResponse = RequestCancelled
- ForceRefresh = False
- CLEAR(GlobalRequest)
- CLEAR(GlobalResponse)
-
- #INSERT(%FileControlOpen)
-
- #EMBED(%BeforeWindowOpening,'Before Opening the Window')
- OPEN(%Window)
- WindowOpened = True
- #IF(%INIActive AND %INISaveWindow)
- INIRestoreWindow('%Procedure','%INIFileName')
- #ENDIF
- #EMBED(%AfterWindowOpening,'After Opening the Window')
- #IF(%SpecifyFirstField AND %FirstFieldToSelect)
- SELECT(%FirstFieldToSelect)
- #ELSE
- #CLEAR(%FirstFieldToSelect)
- #FOR(%Control),WHERE(%ControlType <> 'SHEET' AND %ControlType <> 'TAB' AND %ControlTemplate <> 'AlternateListFormat(ToolCraft)')
- SELECT(%Control)
- #BREAK
- #ENDFOR
- #ENDIF
- #IF(%AlwaysMaximizeOnOpen)
- IF NOT %Window{PROP:Maximize} #<!If Window Not Already Maximize
- %Window{PROP:Maximize} = True #<! Always Maximize Window when First Opened
- END #<!End If
- #ENDIF
-
- #EMBED(%BeforeAccept,'Preparing to Process the Window')
-
- ACCEPT #<!Begin Processing Event Loop
- #<!
- #EMBED(%AcceptLoopBeforeEventHandling,'Accept Loop, Before CASE EVENT() handling')
- CASE EVENT() #<!Process Events for the Window
- #INSERT(%StandardWindowHandling)
- END #<!End Events for Window
- #EMBED(%AcceptLoopAfterEventHandling,'Accept Loop, After CASE EVENT() handling')
-
- #EMBED(%AcceptLoopBeforeFieldHandling,'Accept Loop, Before CASE FIELD() handling')
- CASE FIELD() #<!Process Events for Controls
- #INSERT(%StandardControlHandling)
- END #<!End Events for Controls
- #EMBED(%AcceptLoopAfterFieldHandling,'Accept Loop, After CASE FIELD() handling')
- END #<!End Event Loop
- #<!
- DO ProcedureReturn #<!Cleanup and Exit the Procedure
-
-
- !--------------------------------------------------------------------------------------------------!
- ! InitializeWindow Routine !
- ! !
- ! Initialize and Display window for the first time. !
- !--------------------------------------------------------------------------------------------------!
- InitializeWindow ROUTINE
- #EMBED(%WindowInitializationCode,'Window Initialization Code')
- DO RefreshWindow
-
-
- !--------------------------------------------------------------------------------------------------!
- ! RefreshWindow Routine !
- ! !
- ! Redisplays the fields for the window. !
- !--------------------------------------------------------------------------------------------------!
- RefreshWindow ROUTINE
-
- IF %Window{Prop:AcceptAll} THEN EXIT.
- #EMBED(%RefreshWindowBeforeDisplay,'Refresh Window routine, before DISPLAY()')
- DISPLAY()
- ForceRefresh = False
-
-
- #EMBED(%ProcedureRoutines,'Procedure Routines')
- !--------------------------------------------------------------------------------------------------!
- ! ProcedureReturn Routine !
- ! !
- ! End of procedure cleanup and exit. !
- !--------------------------------------------------------------------------------------------------!
- ProcedureReturn ROUTINE
-
- #INSERT(%FileControlClose)
-
- #INSERT(%StandardWindowClosing)
-
- #EMBED(%EndOfProcedure,'End of Procedure')
- #INSERT(%StandardFormula,'Procedure Exit')
-
- GlobalResponse = LocalResponse
- RETURN
-
-
- #EMBED(%LocalProcedures,'Local Procedures'),HIDE
- #!------------------------------------------------------------------------
- #AT(%DataSectionBeforeWindow)
- #INSERT(%PowerBrowseDeclarations)
- #ENDAT
- #!------------------------------------------------------------------------
- #AT(%AfterWindowOpening)
- #IF(%EnableWindowResize)
- #INSERT(%GenerateResizeOpenWindowHandling)
- #ENDIF
- #INSERT(%GenerateHideListBoxControls)
- #INSERT(%GenerateIconListAssignments)
- #ENDAT
- #!------------------------------------------------------------------------
- #AT(%AcceptLoopBeforeEventHandling),WHERE(%EnableWindowResize)
- IF SELECTED() THEN CurrentSelected = SELECTED(). #<!Save Current Field Selection
- #ENDAT
- #!-------------------------------------------------------------------------
- #AT(%WindowOtherEventHandling),WHERE(%EnableWindowResize)
- #INSERT(%GenerateResizeEventHandling)
- #ENDAT
- #!------------------------------------------------------------------------
- #AT(%ProcedureRoutines),WHERE(%EnableWindowResize)
- #INSERT(%GenerateResizeWindowRoutine)
- #ENDAT
- #!------------------------------------------------------------------------
- #COMMENT(%CmtPos)
- #DEFAULT
- NAME PwrDefaultBrowse
- [COMMON]
- DESCRIPTION 'Browse with update and select'
- FROM ToolCraft PowerBrowse
- [PROMPTS]
- %WindowOperationMode STRING('Use WINDOW setting')
- %INISaveWindow LONG (1)
- [ADDITION]
- NAME ToolCraft BrowseBox
- [INSTANCE]
- INSTANCE 1
- [PROMPTS]
- %LocatorType STRING ('Step')
- %LocatorControl STRING ('')
- %FillLocatorField @S180 ('')
- %HotDisplay LONG (0)
- %UsingMultiDisplay LONG (0)
- %AltFormats MULTI LONG ()
- %OrderDescription DEPEND %AltFormats @S60 TIMES 0
- %OrderKey DEPEND %AltFormats KEY TIMES 0
- %AltFormat DEPEND %AltFormats STRING TIMES 0
- %AltRecordFilter DEPEND %AltFormats @S180 TIMES 0
- %AltRangeField DEPEND %AltFormats COMPONENT TIMES 0
- %AltRangeLimitType DEPEND %AltFormats STRING TIMES 0
- %AltRangeLimit DEPEND %AltFormats @s100 TIMES 0
- %AltRangeLow DEPEND %AltFormats @S100 TIMES 0
- %AltRangeHigh DEPEND %AltFormats @S100 TIMES 0
- %AltRangeFile DEPEND %AltFormats FILE TIMES 0
- %ChangeOrderControl STRING ('')
- %RecordFilter @S180 ('')
- %RangeField COMPONENT()
- %RangeLimitType STRING ('Current Value')
- %RangeLimit @s100 ('')
- %RangeLow @S100 ('')
- %RangeHigh @S100 ('')
- %RangeFile FILE ()
- %UpdateProcedure PROCEDURE ()
- %ParentListControl STRING ('')
-
- [ADDITION]
- NAME ToolCraft SelectButton
- [INSTANCE]
- INSTANCE 3
- PARENT 1
- [PROMPTS]
- %HideIfDisabled LONG (1)
- [ADDITION]
- NAME ToolCraft UpdateButtons
- [INSTANCE]
- INSTANCE 2
- PARENT 1
- [PROMPTS]
- %UpdateProcedure PROCEDURE ()
- [ADDITION]
- NAME Clarion CloseButton
- [INSTANCE]
- INSTANCE 4
- [WINDOW]
- Screen WINDOW('Browse Records'),AT(0,0,247,140),STATUS,SYSTEM,GRAY,MDI
- LIST,AT(5,5,235,100),MSG('Browsing Records'),ALRT(CtrlEnter),ALRT(InsertKey),ALRT(DeleteKey),USE(?List),IMM,FROM(BRWQ),#SEQ(1),#ORIG(BrowseBox)
- BUTTON('Close'),AT(200,110,40,10),USE(?Close),#SEQ(4),#ORIG(?Close)
- BUTTON('Select'),AT(145,110,40,10),KEY(EnterKey),USE(?Select),#SEQ(3),#ORIG(?Select)
- BUTTON('Insert'),AT(5,110,40,10),USE(?Insert),#SEQ(2),#ORIG(?Insert),#LINK(?Change)
- BUTTON('Change'),AT(50,110,40,10),USE(?Change),#SEQ(2),#ORIG(?Change),#LINK(?Delete)
- BUTTON('Delete'),AT(95,110,40,10),USE(?Delete),#SEQ(2),#ORIG(?Delete),#LINK(?Insert)
- END
-
- #ENDDEFAULT
-